﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Training.Dia1.Data;
using Training.Dia1.Data.Entities;

namespace Training.Dia1.Web
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
            Label1.Text = List();

        }
        private string List()
        {
            string r="";
            using(TrainingDia1DbContext ctx = new TrainingDia1DbContext())
            {
                var list= ctx.MeasureUnits.Where(u=>u.Name.Contains("K")).ToList();
                foreach (MeasureUnit value in list)  
                {
                    r += value.Name + "<br>";
                }
            }
            return r;
        }
    }
}